package com.amit;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class DemoServlet extends HttpServlet {
	
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
	String em=request.getParameter("email");
	System.out.println(em);
	
	HttpSession session=request.getSession();
	System.out.println(session.isNew());
	
	String url1="home.jsp;JESSIONID="+session.getId();
	System.out.println(url1);
	String url2=response.encodeURL("home.jsp");
	System.out.println(url2);

	RequestDispatcher rd=request.getRequestDispatcher(url2);
	rd.forward(request, response);
		
	}

}
